package com.huike.builder;


import com.huike.user.pojos.User;

import java.time.LocalDateTime;

public class UserBuilder {
    private User user=new User();
    private String[] strings;
    public UserBuilder(String[] strings) {
        this.strings=strings;
    }

    public UserBuilder buildUser(){
        user.setName(strings[0]);
        user.setUsername(strings[1]);
        user.setPassword(strings[2]);
        user.setPhone(strings[3]);
        user.setPositionId(Integer.valueOf(strings[4]));
        user.setBranchId(Integer.valueOf(strings[5]));
        user.setStatus(Integer.valueOf(strings[6]));
        user.setRoleDivide(Integer.valueOf(strings[7]));
        user.setBranchName(strings[8]);
        user.setCreateTime(LocalDateTime.now());
        user.setUpdateTime(LocalDateTime.now());
        return this;
    }
    public User build(){
        return user;
    }

}
